package com.shen.module_room.bean

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey

/**
 * author:  shen
 * date:    2021/7/5
 *
 * 用户信息
 */
@Entity(tableName = "user_info")
class UserInfoBean{
    @PrimaryKey
    @ColumnInfo(name = "user_id")
    var userId : Long = -1
    var name : String? = ""
    @ColumnInfo(name = "phone")
    var phone : String? = ""

    /* 版本2 添加此字段 */
    @ColumnInfo(name = "head_photo")
    var headPhoto : String? = ""

    /* 版本3 添加此字段 */
    @ColumnInfo(name = "is_login")
    var isLogin : Boolean = false

//    constructor() {
//        userId = -1
//        name = ""
//        phone = ""
//    }
//
//    constructor(userId: Long, name: String, phone: String) {
//        this.userId = userId
//        this.name = name
//        this.phone = phone
//    }
//
//    override fun toString(): String {
//        return "UserInfoBean(userId=$userId, name=$name, phone=$phone)"
//    }


//    constructor() {
//        userId = -1
//        name = ""
//        phone = ""
//        headPhoto = ""
//    }
//    constructor(userId: Long, name: String, phone: String, headPhoto: String) {
//        this.userId = userId
//        this.name = name
//        this.phone = phone
//        this.headPhoto = headPhoto
//    }
//
//    override fun toString(): String {
//        return "UserInfoBean(userId=$userId, name=$name, phone=$phone, headPhoto=$headPhoto)"
//    }

    constructor() {
        userId = -1
        name = ""
        phone = ""
        headPhoto = ""
        isLogin = false
    }
    constructor(userId: Long, name: String, phone: String, headPhoto: String, isLogin: Boolean) {
        this.userId = userId
        this.name = name
        this.phone = phone
        this.headPhoto = headPhoto
        this.isLogin = isLogin
    }

    override fun toString(): String {
        return "UserInfoBean(userId=$userId, name=$name, phone=$phone, headPhoto=$headPhoto, isLogin=$isLogin )"
    }
}
